﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
      <title></title>
      <link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
      <link href="PageModel.css" rel="Stylesheet" type="text/css" />
      <script type="text/javascript" src="../../domExt.min.js"></script>
</head>
<body>
      <div class="fun_title">
            _h.LoadJS(url, IsAsync, cache);
      </div>
      <div class="fun_content">
            描述：动态加载JS文件<br />
      </div>
      <div class="fun_title2">
            参数:
      </div>
      <div class="fun_content2">
           url：Url路径，支持相对路径。<br />
           IsAsync：true 为异步加载，false 为同步加载。默认为false<br />
           cache：true 为缓存文件，false 为不缓存文件 默认为true<br />
      </div>
      <div class="fun_title2">
            示例:
      </div>
      <div class="code">
            test_js.js<br />
            alert(&quot;load js test&quot;);
            <br />
            var testloadjs = true;<br />
            &lt;script type=&quot;text/javascript&quot;&gt;<br />
            &nbsp;&nbsp;&nbsp; _h.LoadJS(&quot;test_js.js&quot;, false, false); 
            <br />
&nbsp;&nbsp;&nbsp; alert(testloadjs);<br />
            &lt;/script&gt;;</div>
            <br />
             <h:btn onclick="run_click();">执行脚本</h:btn>

             <script type="text/javascript">
                   function run_click() {
                         _h.LoadJS("test_js.js", false, false);
                         alert(testloadjs);
                  }
             </script>
     
      
</body>
</html>
